<?php

namespace App\Http\Controllers\Api\Customer;

use App\Facades\WxUserService;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class UserController extends Controller
{
	public function addUser(Request $request)
	{
		$rules = [
			// 'name' => '',
			// 'password' => '',
			// 'head_img' => '',
			'birthday' => 'date_format:Y-m-d',
			// 'nickname' => '',
			// 'address' => '',
			'phone' => 'digits_between:7,11',
			'email' => 'email',
			// 'sex' => '',
		];
		$this->validate($request, $rules);

		WxUserService::addUserInfo($request->only([
			'name',
			// 'head_img',
			'birthday',
			'nickname',
			'address',
			'phone',
			'email',
			'sex',
			]));
		return formatJsonResponse();
	}
}
